<include file="Public/min-header"/>
<div class="wrapper">
  <section class="content">
    <div class="container-fluid">
      <div class="panel panel-default">
		  <form class="navbar-form form-inline" action="/Seller/Promotion/get_goods" method="get">
		    	<div class="form-group">
		    		<input type="text" name="keywords" class="form-control" value="{:I('keywords')}" placeholder="搜索产品">
					<input type="hidden" name="id" value="{:I('id')}">
		    	</div>
		    <button type="submit" class="btn btn-default">搜索</button>
		  </form>
        <div class="panel-body">
          <div class="table-responsive">
              <table class="table table-bordered table-hover">
                  <thead>
                      <td class="text-left">商品名称</td>
                      <td class="text-left">价格</td>
                      <td class="text-left">库存</td>
					  <td class="text-left">操作</td>
                  </tr>
                  </thead> 
                  <tbody id="goos_table">
                      <volist name="goodsList" id="list">
                           <tr>
                               <td class="text-left">{$list.goods_name}</td>
                               <td class="text-left">{$list.shop_price}</td>
                               <td class="text-left">{$list.store_count}</td>
							   <td class="text-left"><a class="btn btn-danger" href="JavaScript:;" id="quxiao" data-id="{$list.goods_id}"><i class="fa fa-trash-o">  取消</i></a></td>
                           </tr>
                    </volist>
                  </tbody>
              </table>
          </div>
          <div class="row">
              <div class="text-left col-sm-10">
                  {$page}
              </div>
              <div class="text-right col-sm-2"></div>
          </div>
        </div>
      </div>
    </div>
	<script>
		$(".panel-body").on("click","#quxiao", function() {
			var goods_id=$(this).attr('data-id');var that=$(this);
			layer.confirm('确定取消活动吗？', {
					  btn: ['确定','取消'] //按钮 
					}, function(){
						$.get("/Seller/Promotion/get_goods?action=quxiao&goods_id="+goods_id,
						    function(data){
						        layer.msg('取消活动成功！', {icon: 6});
								that.parent().parent().remove();
						    });
					});
		 });

	</script>
  </section>
</div>
</body>
</html>